﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EZCRS.HCMS.Data;
using EZCRS.HCMS.Entity;
using System.Data;
using System.Data.SqlClient;

namespace EZCRS.HCMS.SqlClient
{
    public class sql_AdmWebAdminInfo
    {
        private string SqlStr = "";
        #region 后台用户个性表
        public DataSet WebAdminInfo_Item(string Admid)
        {
            try
            {
                string strSql = "select * from hfg_admuser_setup where admid=" + Admid;
                return ExecSql.GetDataSet(strSql);
            }
            catch
            {
                return null;
            }
        }
        #endregion
        #region 后台用户个性表信息添加
        /// <summary>
        /// 添加后台用户个性表
        /// </summary>
        /// <returns></returns>
        public bool WebAdminInfo_Add(string Css, string Languagetype,string helptype, string Admid)
        {
            SqlParameter[] pam = new SqlParameter[4];
            pam[0] = new SqlParameter("@css", Css);
            pam[1] = new SqlParameter("@languagetype", Languagetype);
            pam[2] = new SqlParameter("@admid", Admid);
            pam[3] = new SqlParameter("@helptype", helptype);
            if (Admid != "")
                SqlStr = "insert into hfg_admuser_setup(admid,css,languagetype,helptype) values(@admid,@css,@languagetype,@helptype)";
            if (ExecSql.SqlExecNoquery(SqlStr, pam) > 0)
                return true;
            else
                return false;
        }
        #endregion
        #region 后台用户个性表信息修改
        /// <summary>
        /// 修改后台用户个性表
        /// </summary>
        /// <returns></returns>
        public bool WebAdminInfo_Update(string Css, string Languagetype, string helptype,string Admid)
        {
            SqlParameter[] pam = new SqlParameter[3];
            pam[0] = new SqlParameter("@css", Css);
            pam[1] = new SqlParameter("@languagetype", Languagetype);
            pam[2] = new SqlParameter("@helptype", helptype);
            if (Admid != "")
                SqlStr = "update hfg_admuser_setup set css=@css,languagetype=@languagetype,helptype=@helptype where admid=" + Admid + "";
            if (ExecSql.SqlExecNoquery(SqlStr, pam) > 0)
                return true;
            else
                return false;
        }
        #endregion
    }
}
